package com.sheledon.flyCat.core.factory;

import com.sheledon.flyCat.core.handler.GetRequestHandler;
import com.sheledon.flyCat.core.handler.PostRequestHandler;
import com.sheledon.flyCat.core.handler.RequestHandler;
import com.sheledon.flyCat.network.socket.http.enum_.HttpMethod;

/**
 * @author sheledon
 */
public class RequestHandlerFactory {
    public static RequestHandler getRequestHandler(HttpMethod method){
        if (HttpMethod.GET.equals(method)){
            return new GetRequestHandler();
        }
        if (HttpMethod.POST.equals(method)){
            return new PostRequestHandler();
        }
        return null;
    }
}
